# liveMedia目录Makefile（精简版）

# 默认变量值（可从父Makefile传递）
CROSS_COMPILE ?= /usr/bin/
INCLUDES ?= -I../../include -I../../include/liveMedia -I../../include/groupsock -I../../include/UsageEnvironment -I../../include/BasicUsageEnvironment
COMPILE_OPTS ?= $(INCLUDES)
C_COMPILER ?= $(CROSS_COMPILE)gcc
C_FLAGS ?= $(COMPILE_OPTS)
CPLUSPLUS_COMPILER ?= $(CROSS_COMPILE)g++
CPLUSPLUS_FLAGS ?= $(COMPILE_OPTS)
OBJ ?= o
LIBRARY_LINK ?= $(CROSS_COMPILE)ar cr
LIB_SUFFIX ?= a

# 核心流媒体文件（精简版）
OBJS = Media.$(OBJ) MediaSource.$(OBJ) FramedSource.$(OBJ) RTPSink.$(OBJ) \
       RTSPServer.$(OBJ) DynamicRTSPServer.$(OBJ) ServerMediaSession.$(OBJ) \
       ServerMediaSubsession.$(OBJ) ByteStreamFileSource.$(OBJ) \
       H264VideoRTPSink.$(OBJ) H264VideoRTPSource.$(OBJ) \
       H264VideoStreamDiscreteFramer.$(OBJ) H264VideoStreamFramer.$(OBJ) \
       H264VideoFileServerMediaSubsession.$(OBJ) \
       MPEG4VideoRTPSink.$(OBJ) MPEG4VideoRTPSource.$(OBJ) \
       MPEG4VideoStreamDiscreteFramer.$(OBJ) \
       MPEG4VideoStreamFramer.$(OBJ) MPEG4VideoFileServerMediaSubsession.$(OBJ) \
       ADTSAudioFileServerMediaSubsession.$(OBJ) ADTSAudioRTPSink.$(OBJ) \
       AMRAudioFileServerMediaSubsession.$(OBJ) AMRAudioRTPSink.$(OBJ) \
       BasicUDPSink.$(OBJ) BasicUDPSource.$(OBJ) \
       MediaSession.$(OBJ) MediaSink.$(OBJ) FramedFilter.$(OBJ) \
       RTCP.$(OBJ) RTPInterface.$(OBJ) GroupsockHelper.$(OBJ) \
       StreamParser.$(OBJ) RTSPCommon.$(OBJ) FileServerMediaSubsession.$(OBJ) \
       SimpleRTPSink.$(OBJ) SimpleRTPSource.$(OBJ) \
       uLawAudioFilter.$(OBJ) uLawAudioRTPSink.$(OBJ) \
       H264or5VideoRTPSink.$(OBJ) H264or5VideoRTPSource.$(OBJ)

# 库文件
NAME = libliveMedia

# 默认目标
all: $(NAME).$(LIB_SUFFIX)

# 编译规则
.$(CPP).$(OBJ):
	$(CPLUSPLUS_COMPILER) -c $(CPLUSPLUS_FLAGS) $<

.$(C).$(OBJ):
	$(C_COMPILER) -c $(C_FLAGS) -o $@ $<

# 链接库
$(NAME).$(LIB_SUFFIX): $(OBJS)
	$(LIBRARY_LINK) $@ $^

# 清理
clean:
	rm -f $(OBJS) $(NAME).$(LIB_SUFFIX)

# 伪目标
.PHONY: all clean
